﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FrameWorkSystem
{
    public partial class frmLogin : DevComponents.DotNetBar.Office2007Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }
        public frmLogin(string Uname, string password)
        {
            InitializeComponent();
            //
            txt_UserName.Text = Uname;
            txt_Password.Text = password;
        }
        private void frmLogin_Load(object sender, EventArgs e)
        {
            this.ActiveControl = txt_UserName;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txt_UserName.Text.Trim() == "" | txt_Password.Text.Trim() == "")
            {
                MessageBox.Show("User Name và Password không được để trống...");
                this.ActiveControl = txt_UserName;
                return;
            }
            this.DialogResult = DialogResult.OK;
        }

        private void txt_Password_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                btnOK_Click(sender, e);
        }
    }
}
